<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>Section A.8.&nbsp; Chapter 8</title>
<link rel="STYLESHEET" type="text/css" href="images/style.css">
<link rel="STYLESHEET" type="text/css" href="images/docsafari.css">
<script type="text/javascript"><!--
google_ad_client = "pub-0203281046321155";
google_alternate_ad_url = "http://www.bookhtml.com/adbrite.htm";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="4867465545";
google_color_border = "FFFFFF";
google_color_link = "0000FF";
google_color_bg = "FFFFFF";
google_color_text = "000000";
google_color_url = "0000FF";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-APP-A-SECT-7.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-APP-A-SECT-9.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
<br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><TD valign="top"><a name="learnphpmysql-APP-A-SECT-8"></a>
<h3 id="title-IDAHVVJ" class="docSection1Title">A.8. Chapter 8</h3>
<dl class="docList">
<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 8-1</span></span></p></dt>
<dd><p class="docList">The <tt>mysql</tt> command provides an interactive interface to MySQL.</p></dd>

<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 8-2</span></span></p></dt>
<dd><p class="docList">To back up a database called "blog" from the command line, execute:</p>
<pre>
mysqldump -u root -p blog &gt; my_backup.sql
</pre><br>

<p class="docList">A password prompt appears before the backup begins.</p>
</dd>

<dt><BR><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 8-3</span></span></p></dt>
<dd><p class="docList">To restore the "blog" backup file from the command line, execute:</P>
<pre>
mysql -u root -p <B>-D test</b> &lt; my_backup.sql
</pre><br>

<p class="docList">A password prompt appears before the restore begins.</P>
</dd>

<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 8-4</span></span></p></dt>
<dd><p class="docList">The advantages for creating an index are:</P>
<ul><LI><p class="docList">Queries with <tt>where</tt> clauses that match the index columns are much faster.</p></li><LI><p class="docList">Verifying the uniqueness of an index value is much faster.</P></li></UL>
<p class="docList">Some disadvantages are:</p>
<ul><LI><p class="docList">Queries that insert or remove rows from an indexed table take longer for the index to update.</P></li><li><p class="docList">Additional storage space is required to store the index.</p></li></UL>
</dd>
</dl>

<a href="11011536.html"><img src="images/pixel.jpg" alt="" width="1" height="1" border="0"></a></TD></TR></table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-APP-A-SECT-7.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-APP-A-SECT-9.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
</body></html>
